package com.example.newapplication;

import android.widget.TimePicker;

public class displayUpdater extends MainActivity {

	 public static void updateDisplay(TimePicker timePicker, int hourOfDay, int minute) { 

 	    // do calculation of next time 
 	    int nextMinute = 0;     
 	    if (minute >= 45 && minute <= 59)
 	        nextMinute = 45;
 	    else if(minute >= 30)
 	        nextMinute = 30;
 	    else if(minute >= 15)
 	        nextMinute = 15;
 	    else if(minute > 0)
 	        nextMinute = 0;
 	    else {          
 	        nextMinute = 45;
 	    }

 	    // remove ontimechangedlistener to prevent stackoverflow/infinite loop
 	    timePicker.setOnTimeChangedListener(mNullTimeChangedListener);

 	    // set minute
 	    timePicker.setCurrentMinute(nextMinute);

 	    // hook up ontimechangedlistener again
 	    timePicker.setOnTimeChangedListener(mStartTimeChangedListener);

 }	
	
	
}
